package com.dev.op.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dev.op.entity.TestCase;
import com.dev.op.mapper.TestCaseMapper;
import com.dev.op.service.TestCaseService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author Administrator
* @description 针对表【test_case】的数据库操作Service实现
* @createDate 2025-03-23 11:23:32
*/
@Service
public class TestCaseServiceImpl extends ServiceImpl<TestCaseMapper, TestCase>
    implements TestCaseService {



    @Override
    public List<TestCase> getTestCaseListByProblemId(Integer problemId) {
        LambdaQueryWrapper<TestCase> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(TestCase::getProblemId,problemId);
        return this.list(queryWrapper);
    }

    @Override
    public List<TestCase> getSampleTestCaseListByProblemId(Integer problemId) {
        LambdaQueryWrapper<TestCase> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(TestCase::getProblemId,problemId).eq(TestCase::getIsSample,1);
        return this.list(queryWrapper);
    }
}




